package pers.zc.activiti.shejimoshi.guanchazhe.guanchazhe2;

/**
 * @description 观察者实现类,
 * @Author Lin FuYuan
 * @date 2020/1/6
 */
public class GuanChaZheShiXian implements Observer{
    private String name;
    private String status;
    private int version;
    public GuanChaZheShiXian(String name,String status){
        this.name = name;
        this.status = status;
    }

    @Override
    public void update(int version) {
         this.version = version;
        System.out.println("新版本来了,当前版本:  "+version+" 当前状态:   "+status);
        this.buy();
    }



    public void buy(){
        System.out.println(name+"   购买了第    "+version+" 期杂志,状态是:"+status);
    }
}
